class Solution1 {
    public void moveZeroes(int[] nums) {
        for (int cur = 0, dest = -1; cur < nums.length; cur++) {
            if (nums[cur] != 0) {
                dest++;
                int tmp = nums[cur];
                nums[cur] = nums[dest];
                nums[dest] = tmp;
            }
        }
    }

    public static void main(String[] args) {
        Solution1 solution1 = new Solution1();
        solution1.moveZeroes(new int[]{0, 1, 0, 3, 12});
    }
}